
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link href="<%=basePath %>bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="<%=basePath %>bootstrap/bootstrap-table/dist/bootstrap-table.css" rel="stylesheet"/>
    <script src="<%=basePath %>bootstrap/js/jquery.min.js"></script>
    <script src="<%=basePath %>bootstrap/js/bootstrap.min.js"></script>
    <script src="<%=basePath %>bootstrap/bootstrap-table/dist/bootstrap-table.min.js"></script>
    <script src="<%=basePath %>bootstrap/bootstrap-table/dist/locale/bootstrap-table-zh-CN.min.js"></script>
    <script src="<%=basePath %>bootstrap/bootbox/bootbox.min.js"></script>
    <script src="<%=basePath %>bootstrap/commend/initcommend.js"></script>
    <style type="text/css">
        .table {table-layout:fixed;}
    </style>
</head>
<body>
<div class="col-md-12" >

    <table
            id="table"
            data-toggle="table"
            data-search="true"
            data-url="../deptMapper/selectDeptUpcomingPaper?deptid=${deptid}"
            >
        <thead>
        <tr>
            <th data-field="evalDeptNameString" data-width="300" data-formatter="operateFormatter">评价科室</th>
            <th data-field="name">评价问卷名称</th>
            <th data-field="papername" data-formatter="caozuoformatter" data-events="operateEvent">操作</th>
        </tr>
        </thead>
    </table>
</div>
<form action="<%=basePath%>/eval/evalPage" method="post" name="form1">
    <input type="hidden" name="paperId">
    <input type="hidden" name="cycledate">
</form>
</body>
<script>
    function operateFormatter(value, row) {
        value=value?value:'';
        var length=value.length;
        if(length&&length>7){
            length=20;
        }

       return "<span title ='"+value+"'>"+value.substring(0,length)+"</span>"
    }
    function caozuoformatter() {
        var buttonarray = new Array();
        buttonarray[0] = '<button type="button" class="RoleOfedit btn btn-primary  btn-sm" style="margin-right:15px;">填报调查问卷</button>';
        return buttonarray.join('');
    }
    window.operateEvent = {
        'click .RoleOfedit': function (e, value, row, index) {
            $("input[name=paperId]").val(row.paperId);
            $("input[name=cycledate]").val(row.cycledate);
            $("form[name=form1]").submit();
        }
    }


</script>
</html>